/**
 * Copyright &copy; 2016-2017 <a href="https://www.lczyfz.com">联创智云</a> All rights reserved.
 */
package com.lczyfz.campusinfo.modules.campusinfoeducation.web;

import com.lczyfz.campusinfo.common.utils.ApiResultUtils;
import com.lczyfz.campusinfo.common.web.BaseController;
import com.lczyfz.campusinfo.modules.campusinfoeducation.entity.CampusinfoCountry;
import com.lczyfz.campusinfo.modules.campusinfoeducation.entity.CampusinfoRegion;
import com.lczyfz.campusinfo.modules.campusinfoeducation.service.CampusinfoCountryService;
import com.lczyfz.campusinfo.modules.campusinfoeducation.service.CampusinfoRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 国家管理Controller
 *
 * @author yt
 * @version 2017-10-20
 */
@Controller
@RequestMapping(value = "api/campusinfoeducation/campusinfoCountry")
public class CampusinfoCountryApiController extends BaseController {
    @Autowired
    private CampusinfoRegionService campusinfoRegionService;
    @Autowired
    private CampusinfoCountryService campusinfoCountryService;
    @RequestMapping(value = "countryList") //国家接口
    @ResponseBody
    public Map<String, Object> getcampusinfoCountry(CampusinfoCountry campusinfoCountry, HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> map = ApiResultUtils.getBaseMapSuccess();
        List<CampusinfoCountry> campusinfoCountries = campusinfoCountryService.findList(campusinfoCountry);
        map.put("page",campusinfoCountries);
        return map;
    }
    @RequestMapping(value = "regionList")
    @ResponseBody  //地区接口
    public Map<String, Object> getcampusinfoRegion(CampusinfoRegion campusinfoRegion, HttpServletRequest request, HttpServletResponse response) {
        Map<String, Object> map = ApiResultUtils.getBaseMapSuccess();
        List<CampusinfoRegion> campusinfoCountries = campusinfoRegionService.findList(campusinfoRegion);
        map.put("page",campusinfoCountries);
        return map;
    }
}